package edu.sctu.practice.class02.shuqiqi.text19;

/**
 * Created by admin on 2015/11/2.
 */

/**
 * 三角形
 */
public class Triangle extends Graph1 {
    int wide = 3;
    int height = 4;
    int length = 3;

    public Triangle(String color) {
        super("pink");
        System.out.println("三角形");
        System.out.println("颜色:" + color);
        System.out.println("宽：" + wide + "\n高：" + height + "\n长" + length);

    }

    public double getArea() {

        double area = (wide * height) / 2;
        System.out.println("面积为：" + area);
        return area;

    }

    public double getPerimeter() {
        double perimeter = 3 * length;
        System.out.println("周长为：" + perimeter);
        return perimeter;
    }


}
